<?php

namespace App\Http\Controllers\Backend\Api\V1;

use App\Http\Requests\Backend\SpaceSchemeContentRequest;
use App\Services\Gallery\Interfaces\SpaceSchemeContentServiceInterface;
use App\Services\Gallery\Services\SpaceSchemeContentService;
use Illuminate\Http\Request;

class SpaceSchemeContentController extends BaseController
{
    /**
     * @var SpaceSchemeContentService
     */
    protected $SpaceSchemeContentService;

    public function __construct(SpaceSchemeContentServiceInterface $SpaceSchemeContentService)
    {
        $this->SpaceSchemeContentService = $SpaceSchemeContentService;
    }

    public function store(SpaceSchemeContentRequest $request)
    {
        $this->SpaceSchemeContentService->set($request->filldata());
        return $this->success();
    }

    public function edit($id)
    {
        $space_scheme_content = $this->SpaceSchemeContentService->get($id);
        return $this->successData(compact('space_scheme_content'));
    }

    public function update(SpaceSchemeContentRequest $request, $id)
    {
        $this->SpaceSchemeContentService->set($request->filldata(), $id);
        return $this->success();
    }

    public function destroy($id)
    {
        $this->SpaceSchemeContentService->destroy($id);
        return $this->success();
    }
}
